#ifndef __FILEDISPAT_H_
#define __FILEDISPAT_H_


#include "pthreadpool.h"


typedef struct filestruct{
	int mark;			
	int fd_size;			//文件大小
	int file_size;			//文件名字长度
	int name_size;			//用户名字长度
	char *filename;			//文件名字
	char *target_user; 		//用户名字
}filestruct;

int get_filesize(const char *pathname,int *fd);
int server_transfer_data(Conndata *data,char *buf);
ssize_t recvn_read_only(int fd, void *vptr, size_t n);
ssize_t readn(int fd, void *vptr, size_t n);
ssize_t writen(int fd, const void *vptr, size_t n);
int read_fifo_mark(int fd);
int send_file(int net_fd,int file_fd,size_t n,filestruct *data,const char *user);
int send_file_data(int fd,char *data,struct filestruct *file_data,const char *name);
int recv_file_data(int fd,char *data,struct filestruct *file_data,char *name);

#endif